package com.jiazhong.mingxing.project.bookstore.front.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiazhong.mingxing.project.bookstore.commons.bean.Category;
import com.jiazhong.mingxing.project.bookstore.commons.mapper.CategoryMapper;
import com.jiazhong.mingxing.project.bookstore.commons.util.JsonResult;
import com.jiazhong.mingxing.project.bookstore.commons.util.ResultTool;
import com.jiazhong.mingxing.project.bookstore.front.service.CategoryService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {

    @Cacheable(cacheNames = "findAllCategory",key = "0")
    public JsonResult findAllCategory() {
        return ResultTool.success(list());
    }
}
